using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;

namespace GameLogic
{
    public class EventTriggerEx : MonoBehaviour, IDragHandler, IEndDragHandler, IScrollHandler
    {
        [SerializeField] UnityEvent<PointerEventData> m_OnDragCallback = new UnityEvent<PointerEventData>();
        [SerializeField] UnityEvent<PointerEventData> m_OnDragEndCallback = new UnityEvent<PointerEventData>();
        [SerializeField] UnityEvent<PointerEventData> m_OnScrollCallback = new UnityEvent<PointerEventData>();

        public UnityEvent<PointerEventData> OnDragCallback { get => m_OnDragCallback; set => m_OnDragCallback = value; }
        public UnityEvent<PointerEventData> OnDragEndCallback { get => m_OnDragEndCallback; set => m_OnDragEndCallback = value; }
        public UnityEvent<PointerEventData> OnScrollCallback { get => m_OnScrollCallback; set => m_OnScrollCallback = value; }

        public void OnDrag(PointerEventData eventData)
        {
            m_OnDragCallback.Invoke(eventData);
        }

        public void OnEndDrag(PointerEventData eventData)
        {
            m_OnDragEndCallback.Invoke(eventData);
        }

        public void OnScroll(PointerEventData eventData)
        {
            m_OnScrollCallback.Invoke(eventData);
        }

        // Start is called before the first frame update
        void Start()
        {
        
        }

        // Update is called once per frame
        void Update()
        {
        
        }
    }
}
